﻿@model IEnumerable<WebSoftSeo.Models.News>
@using WebSoftSeo.Models
@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
    News Banner = ViewBag.Banner;
}

<div class="mar10 borall">
    <div class="floatl">
        <span class="floatl">
            <img src="/Areas/Admin/images/icon-48-generic.png" /></span> 
        <span class="title-name">News's Banner</span>
    </div>

</div>
<!--end borall-->

   <div class="clear0"></div>
    <div class="mar10 borall">
        <table class="formtable">
            <tbody>
    <tr>
        <th>
            Thể Loại
        </th>
        <th>
           Tổng quát
        </th>
         <th style="float:right">Action</th>
    </tr>

@if(Banner != null)
{
    <tr>
        <td style="width:30%">
            @Banner.CategoriesName
        </td>
        
        <td style="width:50%">
            @Banner.Summary
        </td>
 
         
        
         <td style="float:right">
                        <a class="button blue" title="Sửa" href="/@WebSoftSeo.Models.GlobalVariables.PathFolderName/News/EditBanner?id=@Banner.NewsID">
                            <div class="icon">
                                <p class="ic-edit"></p>
                            </div>
                        </a>
                       
                    </td>
    </tr>
}

          <tbody>
        </table>
         <script>$("tr:even").css("background-color", "#f2f2f2");</script>
    </div>



<div class="mar10 borall">
    <div class="floatl">
        <span class="floatl">
            <img src="/Areas/Admin/images/icon-48-generic.png" /></span> 
        <span class="title-name">Bài viết</span>
    </div>
    <ul class="floatr toolbar-list">
        <li class="button">
            <a class="toolbar" href="/@WebSoftSeo.Models.GlobalVariables.PathFolderName/News/Create">
                <span class="icon-32-new"></span>
                Thêm mới
            </a>
        </li>
    </ul>
</div>
<!--end borall-->

   <div class="clear0"></div>
    <div class="mar10 borall">
        <table class="formtable">
            <tbody>
    <tr>
        <th>
            Tiêu đề
        </th>
        <th>
            Hình
        </th>

        <th>
            Mô tả ngắn
        </th>
        
       
     
        <th>
            Ngày viết
        </th>
         <th style="width: 80px">Action</th>
    </tr>

@foreach (var item in Model) { DateTime dt = (DateTime)item.CreatedDate;
                    string date = dt.ToString("HH:mm dd/MM/yyyy");
    <tr>
        <td style="width:30%">
            @Html.DisplayFor(modelItem => item.Title)
        </td>
         <td>
                        <img src="/Images/News/@item.ImagePath" style="width:100px; height:78px" />
                    </td>
        <td style="width:40%">
            @Html.DisplayFor(modelItem => item.ShortDescription)
        </td>
         <td >
             
            @Html.DisplayFor(modelItem => date)
        </td>
        
         <td>
                        <a class="button blue" title="Sửa" href="/@WebSoftSeo.Models.GlobalVariables.PathFolderName/News/Edit?id=@item.NewsID">
                            <div class="icon">
                                <p class="ic-edit"></p>
                            </div>
                        </a>
                        <a class="button red" href="/@WebSoftSeo.Models.GlobalVariables.PathFolderName/News/Delete?id=@item.NewsID" title="Xóa">
                            <div class="icon">
                                <p class="ic-delete"></p>
                            </div>
                        </a>
                    </td>
    </tr>
}
          <tbody>
        </table>
         <script>$("tr:even").css("background-color", "#f2f2f2");</script>
    </div>


